package com.ruoyi.system.service.impl;


import com.ruoyi.common.annotation.DataScope;
import com.ruoyi.system.domain.CompanyInfo;
import com.ruoyi.system.domain.InstitutionInfo;
import com.ruoyi.system.domain.SysUser;
import com.ruoyi.system.mapper.InstitutionInfoMapper;
import com.ruoyi.system.mapper.UserInfoMapper;
import com.ruoyi.system.service.IRegisterUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class RegisterUserServiceImpl implements IRegisterUserService {

    @Autowired
    private InstitutionInfoMapper institutionInfoMapper;

    @Autowired
    private UserInfoMapper userInfoMapper;


    @Override
    @DataScope(tableAlias = "u")
    public List<CompanyInfo> selectAllRegisterUser() {
        return (List<CompanyInfo>) institutionInfoMapper.selectAllRegisterUser();
    }

    @Override
    public List<String> selectAllRegisterCompanyList() {
        return (List<String>) institutionInfoMapper.selectAllRegisterCompanyList();
    }

    @Override
    public List<CompanyInfo> selectUserList(CompanyInfo companyInfo) {
        return institutionInfoMapper.selectUserList(companyInfo);
    }

    @Override
    public List<CompanyInfo> getSearchResult(CompanyInfo companyInfo) {
        return institutionInfoMapper.selectUserList(companyInfo);
    }


    @Override
    public CompanyInfo selectRegisterUserByID(long userid) {
        return institutionInfoMapper.selectRegisterUserByID(userid);
    }


    @Override
    public  int selectAllRegisterUserCount() {
        return institutionInfoMapper.selectAllRegisterUserCount();
    }

    @Override
    public List<InstitutionInfo> selectRegisterUserByDay() {
        return (List<InstitutionInfo>) institutionInfoMapper.selectRegisterUserByDay();
    }

    @Override
    public List<InstitutionInfo> selectRegisterUserByWeek() {
        return (List<InstitutionInfo>) institutionInfoMapper.selectRegisterUserByWeek();
    }

    @Override
    public List<InstitutionInfo> selectRegisterUserByMonth() {
        return (List<InstitutionInfo>) institutionInfoMapper.selectRegisterUserByMonth();
    }

    @Override
    public List<InstitutionInfo> selectRegisterUserByQuarter() {
        return (List<InstitutionInfo>) institutionInfoMapper.selectRegisterUserByQuarter();
    }
    @Override
    public List<InstitutionInfo> selectRegisterUserByYear() {
        return (List<InstitutionInfo>) institutionInfoMapper.selectRegisterUserByYear();
    }

    @Override
    public int deleteByPrimaryKey(int ids) throws Exception {
        return institutionInfoMapper.deleteByPrimaryKey(ids);
    }

    @Override
    public int insert(InstitutionInfo institutionInfo) throws Exception {
        return institutionInfoMapper.insert(institutionInfo);
    }

    @Override
    public int updateByPrimaryKeySelective(InstitutionInfo institutionInfo) {
        return institutionInfoMapper.updateByPrimaryKeySelective(institutionInfo);
    }

    @Override
    public List<InstitutionInfo> selectSevenDaysUsers() {
        return (List<InstitutionInfo>) institutionInfoMapper.selectSevenDaysUsers();
    }

    @Override
    public List<InstitutionInfo> selectThirtyDaysUsers() {
        return (List<InstitutionInfo>) institutionInfoMapper.selectThirtyDaysUsers();
    }
}
